package zhtt.demo01;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * Created by zhtt on 2017/4/27.
 */
public interface BlogMapper {

    @Select("SELECT * FROM mybatis_blog WHERE id = #{id}")
    Blog selectBlog(int id);

    @Insert("insert into mybatis_blog(title,des) values (#{blog.title},#{blog.des})")
    int save(@Param("blog") Blog blog);

    @Update("update mybatis_blog set title=#{blog.title},des=#{blog.des} where id=#{blog.id}")
    int update(@Param("blog") Blog blog);
}
